﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bi
{
    public class Class1
    {
        private void NewMethod()
        {
            try
            {
                int port = cmbPort.SelectedIndex + 1;

                if (!RF1356.RFReaderOpen(port))
                {
                    MessageBox.Show("COM Port Open Fail", "Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
                }
                else
                {
                    cmbPort.Enabled = false;
                    //btnAutoOpen.Enabled = false;
                    btnPortOpen.Enabled = false;
                    btnPortClose.Enabled = true;
                    btnReadSerialNO.Enabled = true;
                    chkAuto.Enabled = true;
                    PortNO = port;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
